/* GUI CONVERTED from rewoiqa.p (converter v1.75) Sat Aug 12 23:10:58 2000 */
/* rewoiqa.p - WIP STATUS INQUIRY SUBPROGRAM FOR WIP LOT TRACE          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 9.1   CREATED       : 01/01/99     BY: *N002* Steve Nugent */
/* REVISION: 9.1   LAST MODIFIED : 03/24/00     BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1   LAST MODIFIED : 07/24/00     BY: *N0GS* B. Gates         */
/* REVISION: 9.1   LAST MODIFIED : 08/12/00     BY: *N0KP* myb              */


/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */
/*         THIS PROGRAM IS A BOLT-ON TO STANDARD PRODUCT MFG/PRO.           */
/* ANY CHANGES TO THIS PROGRAM MUST BE PLACED ON A SEPARATE ECO THAN        */
/* STANDARD PRODUCT CHANGES.  FAILURE TO DO THIS CAUSES THE BOLT-ON CODE TO */
/* BE COMBINED WITH STANDARD PRODUCT AND RESULTS IN PATCH DELIVERY FAILURES.*/
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

            {mfdeclre.i}
            {gplabel.i} /* EXTERNAL LABEL INCLUDE */

 /* ********** Begin Translatable Strings Definitions ********** */
 &SCOPED-DEFINE rewoiqa_p_1 " WIP Lot Inventory "
 /* Maxlen:40  Comment: The quantity of Work In Process material in
                        the operation's input, output or reject queue */

 &SCOPED-DEFINE rewoiqa_p_2 "Work Ctr!Machine"
 /* Maxlen:12  Comment: The work center and machine associated with this
                        work-in-process lot at this operation */

 /* ********** End Translatable Strings Definitions ********** */


            define input parameter ip_id like wr_lot no-undo.
            define input parameter ip_op like wr_op no-undo.
            define input parameter ip_um like pt_um no-undo.

            define variable i as integer no-undo.
            define variable queue as character no-undo.
            define variable dummy as character no-undo.
            define variable routing_code as character no-undo.
            define variable effdate as date no-undo.

            {wlcon.i}

/*N0GS*/    FORM /*GUI*/  with STREAM-IO /*GUI*/  frame b down width 80.

            for each wld_det no-lock
            where wld_alloc_id = ip_id
            and wld_alloc_op = ip_op
            and wld_qty <> 0:

            /*V8+*/

            /* GET LANGUAGE MNEMONIC FOR DISPLAY */

            {gplngn2a.i
               &file='wld_det'
               &field='wld_alloc_que'
               &code=wld_alloc_que
               &mnemonic=queue
               &label=dummy}


             do with frame b:
           /* SET EXTERNAL LABELS */
               setFrameLabels(frame b:handle).
               display
               queue @ wld_alloc_que
               wld_prodby_op when(wld_alloc_que = REJECT_QUEUE)
               wld_wkctr column-label {&rewoiqa_p_2}
               wld_lotser
               wld_ref
               wld_qty
               ip_um
               with frame b down width 80 title color normal
               (getFrameTitle("WIP_LOT_INVENTORY",25)) STREAM-IO /*GUI*/ .


               display
                  wld_mch @ wld_wkctr
                  with frame b STREAM-IO /*GUI*/ .

               down 1 with frame b.
             end. /* do with */

               i = i + 1.
            end.


            {gprunmo.i
               &program = ""wlgeteff.p""
               &module = "AWT"
               &param = """(output effdate) no-error"""}

             if effdate = ? then effdate = today.


            for first wo_mstr where wo_lot = ip_id no-lock: end.
            routing_code = if wo_routing = '' then wo_part else wo_routing.

            for last wlrm_mstr where wlrm_routing = routing_code
            and (wlrm_start <= effdate or wlrm_end = ?)
            no-lock: end.

            if not available wlrm_mstr then
            for first wlrm_mstr where wlrm_routing = routing_code
            and wlrm_start = ?
            and (wlrm_end >= effdate or wlrm_end = ?)
            no-lock: end.

            if available wlrm_mstr then do:
               if wlrm_trc_parent and i = 0 then do:
                  {mfmsg.i 8425 1} /* NO WIP LOTS FOUND FOR THIS OPERATION */
               end.
            end.
            else do:
               for first wlc_ctrl no-lock: end.
               if wlc_trc_parent and i = 0 then do:
                  {mfmsg.i 8425 1} /* NO WIPLOTS FOUND FOR THIS OPERATION */
               end.
            end.
